Skip to content

Drop empty and all-zero identifiers - #66

Open
jrosendahl-opt wants to merge 2 commits into
masterfrom
fix/drop-empty-identifiers
Open

jrosendahl-opt wants to merge 2 commits into
masterfrom
fix/drop-empty-identifiers

Conversation

@jrosendahl-opt

@jrosendahl-opt jrosendahl-opt commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Why

A typed identifier whose value was blank after normalization was sent as prefix: (e.g. PostalCode(" ") → z:), and a blank Email or PhoneNumber was hashed, sending e:e3b0c442…b855, the SHA-256 of the empty string, as if it were a real ID. All-zero device advertising IDs (00000000-0000-0000-0000-000000000000), the placeholder Android and iOS return when the user has opted out or tracking isn't authorized, were also sent when passed in, so opted-out devices could share one ID. The iOS SDK now drops these (branch fix/drop-empty-identifiers), and the same behaviour was requested for both SDKs.

What Changed

  • android_sdk: IdentifiersEncoder drops any typed identifier whose encoded value is empty, centrally in the helper every typed identifier goes through (postal code, IPs, device IDs, NetID, ID5, Utiq, Custom, including the visitor ID v).
  • android_sdk: Email and PhoneNumber are dropped when the value is empty after normalization (whitespace removed, lowercased), instead of hashing it.
  • android_sdk: device advertising IDs (the device GAID, AppleIdfa, GoogleGaid, RokuRida, SamsungTifa, AmazonFireAfai) made only of 0 and - after normalization are dropped. IDs with only some zeros are kept.
  • android_sdk tests: every typed identifier with a blank value; all-zero IDs of each device type (with whitespace and without dashes) and the device GAID; an ID with only some zeros is kept.

Hem / HashedPhoneNumber already dropped blank values. Raw is unchanged here; #65 routes known raw types through the typed identifiers, so it gets these rules after a rebase. Dropped identifiers go nowhere: the encoder never adds them, for identify and targeting ids and hids alike.

How to Test

  • ./gradlew test passes (164 tests locally)
  • Verified in DemoAppJava / DemoAppKotlin
  • README updated (if public API changed)

Notes

For 1.3.0: not breaking, only junk values stop being sent. #62 and #65 edit the same encoder and will need a small rebase after this; merging this before #62 is easiest.

  • Breaking change
  • Requires release

🤖 Generated with Claude Code

A typed identifier with a blank value was sent as "prefix:", and a blank
Email or PhoneNumber was hashed, sending the SHA-256 of the empty string
as if it were an ID. Drop both, as the iOS SDK now does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
"00000000-0000-0000-0000-000000000000" is the placeholder Android and iOS
return when the user has opted out or tracking isn't authorized, shared
by every such device. Drop it, like an empty value, for the device GAID
and for AppleIdfa, GoogleGaid, RokuRida, SamsungTifa and AmazonFireAfai.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jrosendahl-opt jrosendahl-opt changed the title Drop identifiers that are empty after normalization Drop empty and all-zero identifiers Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant